// 试卷记录相关接口 paper
import service from '@/utils/request';
const servletMap = [
    // 重新组卷
	['/exam/paper-records/reset-records','resetRecords','post'],
    // 试卷库创建试卷记录
	['/exam/paper-records/public-generate-paper-records','publicGenerateRecords','post'],
    // 生成专项练习试卷记录
	['/exam/paper-records/generate-special-records','generateSpecialRecords','post'],
    // 生成随机试卷记录
	['/exam/paper-records/generate-random-records','generateRandomRecords','post'],
    // 试卷库创建试卷记录
	['/exam/paper-records/generate-paper-records','generateRecords','post'],
    // 生成错题试卷
	['/exam/paper-records/generate-error-records','generateErrorRecords','post'],
    // 专项练习/随机组卷 组卷时返回生成条件
	['/exam/paper-records/question-generate-condition','questionGenerateCondition','get'],
    // 分享后试卷结果查看
	['/exam/paper-records/paper-records-share-result','shareResult','get'],
    // 内部打开试卷结果查看
	['/exam/paper-records/paper-records-inline-result','paperResult','get'],
    // 获取记录列表
	['/exam/paper-records/page','page','get'],
    // 获取试卷记录
	['/exam/paper-records/list','list','get'],
    // 生成试卷分享的密文
	['/exam/paper-records/generate-paper-share','paperShare','get'],
    // 获取科目下完成试卷套数
	['/exam/paper-records/finish-paper-t','finishPaperT','get'],
    // 错题组卷返回可以组卷试题数量
	['/exam/paper-records/error-generate-condition','errorGenerateCondition','get'],


    // 试卷相关接口
	// 批量隐藏/取消隐藏
	['/exam/paper/hide-list','hideList','put'],
    // 增加下载次数、查看次数
	['/exam/paper/add-frequency','addFrequency','put'],
    // 科目下章节未使用的试卷
	['/exam/paper/paperChapterUnused','paperChapterUnused','get'],
    // 获取栏目下的试卷年份
	['/exam/paper/paper-years','paperYears','get'],
    // 
	['/exam/paper/paper-years-kaoyan','paperYearsKaoyan','get'],
    // 考研科目id
	['/exam/paper/paper-category-kaoyan','paperCategory','get'],
    // 根据栏目拉取试卷
	['/exam/paper/paper-by-columnId','paperByColumnId','get'],
    // 根据科目拉取试卷
	['/exam/paper/paper-by-category-kaoyan','paperByCategory','get'],
    // 下载试卷
	['/exam/paper/exportPaper','exportPaper','get'],
    // 查看试卷详情
	['/exam/paper/detail','detail','get'],
    // 客户端查看试卷详情
	['/exam/paper/client-detail','clientDetail','get'],
    // 批量删除试卷
	['/exam/paper/deleted-list','deletedList','delete'],



    // 试题相关接口
    // 解密答案
    ['/exam/question/user-answer-decrypt','decrypt','post'],
    // 单道试题做题
    ['/exam/question/client-one-do','doOne','post'],
    // 新增试题
    ['/exam/question/add-source-q','addSource','post'],
    // 获取那些试卷和章节包括当前试题
    ['/exam/question/question-source','questionSource','get'],
    // 查看试题详情
    ['/exam/question/detail-child','detailChild','get'],

    // 用户删除试题
    ['/exam/question/deleted-list','deletedList','delete'],

    // 每日一练相关接口
    ['/exam/every-day-practice/today-practice','todayPractice','get'],
    // 获取某个时间段的每日一练
    ['/exam/every-day-practice/section-practice','sectionPractice','get'],
    // 每日一练详情
    // ['/exam/every-day-practice/today-practice','todayPractice','get'],
    // 获取用户连续学习天数
    ['/exam/every-day-practice/continuity-days','continuityDays','get'],
    // 获取某一天的每日一练信息
    ['/exam/every-day-practice/aday-practice','adayPractice','get'],
    ['/exam/paper/exportPaper','exportPaper','get'],




];
let obj = {};
for (let i in servletMap) {
	obj[servletMap[i][1]] = function() {
		return service[servletMap[i][2]](servletMap[i][0],...arguments);
	};
}

export default {...obj,
    // 获取记录详情 不包含试题信息
    recordsDetail(id,){
        return service.get('/exam/paper-records/detail/'+id)
    },
    // 获取试卷做题次数
    count(id,){
        return service.get('/exam/paper-records/count/'+id)
    },
	getQuestionDetail:(id)=> service.get('/exam/question/detail/'+id),
};
